package com.cesgroup.zw.spring.boot.library.echarts.pictorialBar.complex;

import com.cesgroup.zw.spring.boot.echarts.build.EChartsOption;
import com.cesgroup.zw.spring.boot.echarts.component.Grid;
import com.cesgroup.zw.spring.boot.echarts.component.Tooltip;
import com.cesgroup.zw.spring.boot.echarts.component.axis.XAxis;
import com.cesgroup.zw.spring.boot.echarts.component.axis.YAxis;
import com.cesgroup.zw.spring.boot.echarts.enums.Align;
import com.cesgroup.zw.spring.boot.echarts.model.axis.AxisLabel;
import com.cesgroup.zw.spring.boot.echarts.model.axis.AxisLine;
import com.cesgroup.zw.spring.boot.echarts.model.axis.AxisTick;
import com.cesgroup.zw.spring.boot.echarts.model.axis.SplitLine;

/**
 * <p>学历象形柱图</p>
 * @author ytj
 * @date 2019/7/8 15:36
 */
@SuppressWarnings("serial")
public class PictorialBarComplexOption extends EChartsOption{
    public PictorialBarComplexOption(PictorialBarComplexParam param){
        this.setBackgroundColor("black");
        this.setTooltip(new Tooltip());
        this.setXAxis(new XAxis(){{
            this.setMax(2000);
            this.setSplitLine(new SplitLine(){{
                this.setShow(false);
            }});
            this.setOffset(10);
            this.setAxisTick(new AxisTick(){{
                this.setShow(false);
            }});
            this.setAxisLine(new AxisLine(){{
                this.setShow(false);
            }});
            this.setAxisLabel(new AxisLabel(){{
                this.setShow(false);
            }});
        }});
        this.setYAxis(new YAxis(){{
            this.setData(param.getDataset().get("name"));
            this.setInverse(true);
            this.setAxisTick(new AxisTick(){{
                this.setShow(false);
            }});
            this.setAxisLine(new AxisLine(){{
                this.setShow(false);
            }});
            this.setAxisLabel(new AxisLabel(){{
                this.setMargin(10);
                this.setColor("#999");
                this.setFontSize(16);
            }});
        }});
        this.setGrid(new Grid(){{
            this.setTop(Align.center);
            this.setHeight(200);
            this.setLeft(100);
            this.setRight(100);
        }});
    }
}
